% !TEX root = ArticoloRF.tex
% gini evaluations
\subsection{Gini Evaluations}

\begin{figure}[htbp]
\begin{center}
\includegraphics[keepaspectratio=true,width=.5\textwidth]{GiniError}
\caption{Gini Index Classification Error}
\label{fig:Gini}
\end{center}
\end{figure}


The results for classification error using the Gini Index based algorithm are shown in Figure \ref{fig:Gini}. The version of the algorithm used to evaluate performances is the second one discussed in section \ref{sec:gini}, i.e. the one that iterates over a subset of the available features chosen at random, $\sqrt{n}$ in this case. As stated before, this modification is aimed at adding a certain degree of randomization within the forest in order to obtain different trees and decrease running time but still performing the best split on the subset taken into consideration. With trees 5 levels deep, the algorithm performances are quite poor, with a classification error that ranges from $16\%$ to a minimum of $10\%$. Skipping to a depth of 10 levels, a strong improvement can be noticed on the graph. Considering an equal number of trees, an additional increment that leads to a depth greater than 10 does not yield considerable improvements in the classification error. Table \ref{tab:GiniError} reports some cases of classification error values.

\begin{table}[htdp]
\caption{Classification Error \% for Gini Index based algorithm}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
Error \%	&10 trees& 50 trees &100 trees\\
	\hline
5 levels & 16.36 & 12.46 & 10.74	\\
\hline
20 levels & 7.18 & 3.89 & 3.61 \\
\hline
30 levels & 7.79 & 4.11 & 4.23 \\
\hline
\end{tabular}
\end{center}
\label{tab:GiniError}
\end{table}%

This algorithm succeeds in lowering classification errors if compared to the random version, keeping nevertheless good performances in terms of running time as shown in table \ref{tab:GiniTimes}.

\begin{table}[htdp]
\caption{Training and Classification Times for Gini Index based algorithm}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
	&Training [s]&Classification [s]\\
	\hline
10 trees of 5 levels & 0.45 & 0.13\\
\hline
100 trees of 5 levels & 2.22 & 1.25\\
\hline
10 trees of 20 levels & 0.70 & 0.02\\
\hline
100 trees of 20 levels & 4.58 & 0.19 \\
\hline
10 trees of 30 levels & 0.80 & 0.02\\
\hline
100 trees of 30 levels & 5.02 & 0.18 \\ 
\hline
\end{tabular}
\end{center}
\label{tab:GiniTimes}
\end{table}%





